<template>
  <transition name="fade" mode="out-in">
    <div class="login">
      <img src="@/assets/login/background_01.png" class="login-bg">
      <div class="title">
        <p class="title-hi">
          <img src="@/assets/login/background_02.png">
        </p>
        <p class="head">
          欢迎来到折折仓，请先登录！
        </p>
        <p class="down">业务推广版</p>
      </div>
      <div class="field">
        <van-field v-model="form.phoneNum" type="number" placeholder="输入绑定手机号" />
        <van-field
          v-model="form.sms"
          center
          clearable
          placeholder="短信验证码"
        >
          <van-button slot="button" size="small" type="default" class="field-btn">获取验证码</van-button>
        </van-field>
        <van-button 
          slot="button" 
          size="large" 
          type="default" 
          class="field-submit"
          @click="login"
        >登录</van-button>
      </div>
    </div>
  </transition>
</template>

<script>
import { Button, Field } from 'vant';
export default {
  components: {
    [Button.name]: Button,
    [Field.name]: Field,
  },
  data () {
    return {
      form: {
        phoneNum: '',
        sms: ''
      }
    }
  },
  mounted() {

  },
  methods: {
    login() {
      this.$router.push('/index')
    }
  },
}
</script>

<style scoped>
.login {
  padding: 120px 32px 0 32px;
  color: #2D2D2E;
  height: calc(100vh - 120px);
  overflow: auto;
  background-color: #fff;
}
.login-bg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
}
.title {
  position: relative;
  padding: 0 0 0 27px;
}
.title-hi {
  display: flex;
  align-items: center;
  position: absolute;
  left: 0;
  top: 0;
  height: 30px;
}
.title-hi img {
  width: 19px;
  height: 19px;
}
.title .head {
  font-size: 20px;
  line-height: 30px;
  white-space: nowrap;
}
.title .down {
  font-size: 12px;
  line-height: 18px;
}
.field {
  margin-top: 90px;
}
.field .van-field {
  border-bottom: 1px solid #E8EAEF;
}
.field-btn {
  border: 0;
}
.field-submit {
  border-radius: 5px;
  color: #fff;
  background-color: #FB999A;
  margin-top: 55px;
}
</style>
